load('nashorn:mozilla_compat.js');
importPackage(java.lang);
importPackage(Packages.tools);
importPackage(Packages.client);
importPackage(Packages.server);
var status = -1;
var itemList = Array(     
        Array(1002728,200,1,1),//圣诞鹿角
		Array(1302081,90,1,1),//永恒
		Array(1332073,90,1,1),
		Array(1342011,90,1,1),
		Array(1382057,90,1,1),
		Array(1402046,90,1,1),
		Array(1432047,90,1,1),
		Array(1442063,90,1,1),
		Array(1452057,90,1,1),
		Array(1462050,90,1,1),
		Array(1472068,90,1,1),
		Array(1482023,90,1,1),
		Array(1492023,90,1,1),
		Array(1122012,90,1,1),//永恒
		Array(1102172,90,1,1),
		Array(1002776,90,1,1),
		Array(1002777,90,1,1),
		Array(1002778,90,1,1),
		Array(1002779,90,1,1),
		Array(1002780,90,1,1),
		Array(1032031,90,1,1),
		Array(1052155,90,1,1),
		Array(1052156,90,1,1),
		Array(1052157,90,1,1),
		Array(1052158,90,1,1),
		Array(1052159,90,1,1),
		Array(1072355,90,1,1),
		Array(1072356,90,1,1),
		Array(1072357,90,1,1),
		Array(1072358,90,1,1),
		Array(1072359,90,1,1),
		Array(1082234,90,1,1),
		Array(1082235,90,1,1),
		Array(1082236,90,1,1),
		Array(1082237,90,1,1),
		Array(1082238,90,1,1),
		Array(1092057,90,1,1),
		Array(1092058,90,1,1),
		Array(1092059,90,1,1),
		Array(1012239,100,1,1),//旭日
		Array(1032093,80,1,1),
		Array(1112584,100,1,1),
		Array(1122104,80,1,1),
		Array(1132085,100,1,1),
		Array(1402037,180,1,1),//龙背
        Array(1012170,40,1,1),//鬼脸
		Array(1003843,40,1,1),//狐狸面具
		Array(1022212,40,1,1),//眼镜
		Array(1152000,250,1,1),//虎爪
		Array(1152001,200,1,1),
		Array(1152009,150,1,1),
		Array(1102084,150,1,1),//粉色盖亚披风
		Array(1102086,300,1,1),//紫色盖亚披风
		Array(1102041,250,1,1),//浪人披风（粉）
		Array(1802082,150,1,1),//宠物装备
		Array(1802083,150,1,1),
		Array(1802084,150,1,1),
        Array(1002939,150,1,1),//安全帽
		Array(1012058,150,1,1),//
        Array(1402063,150,1,1),//樱花伞
		Array(2510169,100,1,1),
		Array(2510260,150,1,1),
		Array(2070006,200,1,1),//齿轮
		Array(2070007,200,1,1),//月牙
		Array(2070005,700,1,1),//金钱镖
		Array(2070004,700,1,1),//黑色刺
		Array(2070003,700,1,1),//雪花
		Array(1092022,700,1,1),//调色盾牌
		Array(1112422,150,1,1),//炫色戒指
		Array(1112423,150,1,1),//银笔尖戒指
		Array(1112424,150,1,1),//墨羽笔戒指
		Array(1112425,150,1,1),//金怀表戒指
		Array(1112426,150,1,1),//蒲公英戒指
		Array(1422011,700,1,1),//酒瓶
       // Array(1002996,700,1,1),//蛋糕帽
		Array(1002799,700,1,1),//月桂冠
	    //Array(1002609,400,1,1),//兔耳魔法帽 
		//Array(1002542,400,1,1),//栗子头 
		Array(1432039,400,1,1),//钓鱼竿
		Array(1422036,700,1,1),//玩具匠人
		Array(1302022,700,1,1),//竹刀
		Array(1402013,700,1,1),//白日
		Array(1012011,700,1,1),//鹿鼻子
		Array(1032032,700,1,1),//
        Array(1051098,700,1,1),//红浴巾
		Array(1050100,700,1,1),//蓝浴巾
		Array(1032026,600,1,1),//黄水晶耳环
		Array(1032027,700,1,1),//黑水晶耳环
		Array(1032028,700,1,1),//红水晶耳环
		Array(1032040,700,1,1),//枫叶型耳环
		Array(1002677,700,1,1),//玩具匠人帽
		Array(1002699,700,1,1),//南瓜帽子
		Array(1002238,400,1,1),//工地帽
		Array(1102040,600,1,1),//浪人披风（黄）
		Array(1102042,600,1,1),//浪人披风（紫）
		Array(1122015,700,1,1),//枫叶围巾
		Array(1332032,600,1,1),//圣诞树
		Array(1432046,400,1,1),//圣诞树手杖
		Array(1002418,600,1,1),//报废报纸头盔
		Array(1002419,700,1,1),//枫叶帽
		Array(1002424,700,1,1),//红马术帽
		Array(1002425,700,1,1),//蓝马术帽
		Array(1012056,700,1,1),//狗狗鼻
		Array(1012132,200,1,1),//鸟鼻
		Array(1022060,700,1,1),//狐猴
		Array(1082252,700,1,1),//枫叶手套
		Array(1012102,700,1,1),//枫叶
		Array(1012103,700,1,1),//枫叶
		Array(4001465,700,5,1),//爱心宝石
		Array(4001465,600,10,1),//爱心宝石
		Array(4001465,500,20,1),//爱心宝石
		Array(4001465,400,50,1),//爱心宝石
		//Array(1102085,700,1,1),//黄色盖亚披风
        Array(1302063,700,1,1),//然烧的火焰刀
		Array(1082145,600,1,1),//工地手套（各种颜色全部+进去）
		Array(1082146,600,1,1),//工地手套（各种颜色全部+进去）
		Array(1082147,600,1,1),//工地手套（各种颜色全部+进去）
		Array(1082148,600,1,1),//工地手套（各种颜色全部+进去）
	    Array(1082149,600,1,1),//工地手套（各种颜色全部+进去）
		Array(1082150,600,1,1),//工地手套（各种颜色全部+进去）
		Array(1002758,700,1,1),//强化版枫叶头盔
		Array(1002511,700,1,1),//枫叶头盔
		/*Array(1302030,500,1,1),//40枫叶
		Array(1332025,500,1,1),//
		Array(1382012,500,1,1),//
		Array(1412011,500,1,1),//
		Array(1422014,500,1,1),//
		Array(1432012,500,1,1),//
		Array(1442024,500,1,1),//
		Array(1452022,500,1,1),//
		Array(1472032,500,1,1),//
		//Array(1342026,500,1,1),//
		Array(1402039,400,1,1),//64枫叶
		//Array(1332055,400,1,1),//
		Array(1332056,400,1,1),//
		Array(1382039,400,1,1),//
		Array(1372034,400,1,1),//
		Array(1412027,400,1,1),//
		Array(1422029,400,1,1),//
		Array(1432040,400,1,1),//
		Array(1442051,400,1,1),//
		Array(1452045,400,1,1),//
		Array(1462040,400,1,1),//
		Array(1472055,400,1,1),//
		Array(1482022,400,1,1),//
		Array(1302036,400,1,1),//
		Array(1312032,400,1,1),//
		Array(1322054,400,1,1),//*/
		Array(1432015,700,1,1),//滑板
		Array(1432016,700,1,1),//
		Array(1432017,700,1,1),//
		Array(1432018,700,1,1),//
		Array(1442016,700,1,1),//
		Array(1442017,700,1,1),//
		Array(1442030,700,1,1),//
		Array(1442046,700,1,1),//
		Array(1442054,700,1,1),//
		Array(1442055,700,1,1),//
		Array(1442056,700,1,1),//
		Array(1442057,700,1,1),//
		Array(1032058,700,1,1),//工作人员C钛质收信机
		Array(1052166,700,1,1),//无敌工作人员套装
		Array(1052165,700,1,1),//降落伞工作人员套装
		Array(1072239,200,1,1),//黄色钉鞋
		Array(1072238,200,1,1),//紫色钉鞋
		Array(1432010,500,1,1),//奥丁手戟
		Array(1302085,700,1,1),//叉子
		Array(1322006,700,1,1),//钢管
		Array(1322031,700,1,1),//葵花宝典
		Array(1332017,400,1,1),//金蛇剑
		Array(1432004,400,1,1),//长八蛇矛
		Array(1432008,400,1,1),//海神叉
		Array(1442009,500,1,1),//月牙戟
		Array(1442044,600,1,1),//战魂斗杀戟
		Array(1472031,600,1,1),//龙之拳
		Array(1472053,600,1,1),//逆龙咆哮拳
		Array(2340000,700,1,1), //祝福卷轴
		Array(2340000,600,2,1), //祝福卷轴
		Array(2049100,700,1,1),//混沌卷轴60%
		Array(2049116,200,1,1),//强化混沌卷轴60%
		Array(2049300,200,1,1),//高级装备强化卷轴
		Array(2049301,400,1,1),//装备强化卷轴
		Array(2049000,500,1,1),//白E
		/*Array(3010012,800,1,1), //剑士宝座
		Array(3015051,50,1,1), //国际巨星
		Array(3015341,50,1,1), //黑猫房车
		Array(3010832,50,1,1), //太阳
		Array(3010876,100,1,1), //冒险岛行星
		Array(3010824,100,1,1), //水星
		Array(3010825,100,1,1), //金星
		Array(3010826,100,1,1), //地球
		Array(3010827,100,1,1), //火星
		Array(3010828,100,1,1), //木星
		Array(3010829,50,1,1), //土星
		Array(3010830,100,1,1), //天王星
		Array(3010831,100,1,1), //海王星
		Array(3010416,50,1,1), //巨无霸白雪人
		Array(3010417,50,1,1), //巨无霸企鹅王*/
		//Array(3010040,800,1,1), //蝙蝠椅
		//Array(3010811,700,1,1), //嫩芽椅
		//Array(3010812,700,1,1), //旋转木马椅
		Array(3010835,500,1,1), //爱情水晶球记忆椅
		//Array(3010045,200,1,1), //寒冰椅子
		Array(3015002,100,1,1), //七彩摩天轮
		Array(3015014,200,1,1), //千钧一发！
		/*Array(3010068,300,1,1), //露水椅子
		Array(3010085,100,1,1), //鬼娃娃椅子
		Array(3010094,800,1,1), //漂漂猪椅子
		Array(3010095,800,1,1), //石头人座椅
		Array(3010099,700,1,1), //北极熊椅子
		Array(3010100,200,1,1), //财神椅子
		Array(3010110,800,1,1), //舒适大白熊椅子
		Array(3010116,800,1,1), //摇滚之魂椅子
		Array(3010112,800,1,1), //情书柜子
		Array(3010111,800,1,1), //虎虎生威
		Array(3010117,700,1,1), //魔法书椅子*/
		Array(3015015,400,1,1), //星座椅子
		Array(3015016,400,1,1), //
		Array(3015017,400,1,1), //
		Array(3015018,400,1,1), //
		Array(3015019,400,1,1), //
		Array(3015020,400,1,1), //
		Array(3015021,400,1,1), //
		Array(3015022,400,1,1), //
		Array(3015023,400,1,1), //
		Array(3015024,400,1,1), //
		Array(3015025,400,1,1), //
		Array(3015026,400,1,1), //星座椅子
		//Array(3010118,700,1,1), //糖果音符椅子
		Array(3015075,200,1,1), //铲雪狂人椅子
		//Array(3010119,800,1,1), //羊羊椅子
		Array(3015111,200,1,1), //青蛙飓风飞椅
		//Array(3010124,700,1,1), //都纳斯喷气椅子
		Array(3015157,200,1,1), //安德洛墨达椅子
		//Array(3010025,200,1,1), //5周年枫叶纪念凳
		Array(3015181,200,1,1), //仲夏夜之梦椅子
		//Array(3010107,800,1,1), //龙龙的蛋壳椅
		Array(3015262,300,1,1), //满月清辉椅子
		//Array(3010109,800,1,1), //暖炉椅
		Array(3015276,300,1,1), //拳王乌鲁斯椅子
		//Array(3010113,600,1,1), //幽魂发条熊椅子
		Array(3015310,300,1,1), //塞维利亚西班牙广场椅子
		/*Array(3010114,500,1,1), //俘虏我吧
		Array(3010055,800,1,1), //冰雪糕丸子椅
		Array(3010145,400,1,1), //6周年庆水晶枫叶椅子*/
		Array(3015325,300,1,1), //夜晚满月椅子
		Array(3015326,300,1,1), //叮当叠罗汉椅子
		Array(3015327,300,1,1), //梦之蝴蝶椅子
		//Array(3010078,600,1,1), //大熊猫椅子
		Array(3016000,200,1,1), //大象跷跷板椅子
		//Array(3015100,600,1,1), //布偶兔
		/*Array(3010079,700,1,1), //肥猫猫椅子
		Array(3010129,800,1,1), //酋长宝座
		Array(3010154,800,1,1), //机械椅子
		Array(3010157,800,1,1), //家族椅子
		//Array(3013001,400,1,1), //ドラム椅子
		Array(3010135,700,1,1), //节日独角兽椅子
		Array(3010168,500,1,1), //友谊万岁椅子
		Array(3010170,700,1,1), //雪夜椅子
		Array(3010172,700,1,1), //星空椅子
		Array(3010175,800,1,1), //名画家椅子
		Array(3010142,700,1,1), //水族馆椅子
		Array(3010141,800,1,1), //蛋糕椅子*/
		/*Array(3015565,100,1,1), //星球椅子
		Array(3015567,100,1,1), //
		Array(3015568,100,1,1), //
		Array(3015570,100,1,1), //
		Array(3015571,100,1,1), //
		Array(3015572,100,1,1), //星球椅子*/
		Array(3010151,700,1,1), //无人岛椅子
		//Array(3012022,300,1,1), //寿司
		//Array(3015053,700,1,1), //三重羊
		/*Array(3010004,700,1,1), //黄蓝休闲椅
		Array(3010005,700,1,1), //红蓝休闲椅
		Array(3010006,700,1,1), //黄色时尚转椅
		Array(3010018,600,1,1), //椰子树沙滩椅
		Array(3010019,700,1,1), //寿司椅*/
		Array(3010046,700,1,1), //红龙椅
		Array(3010047,700,1,1), //蓝龙椅
		Array(3010071,200,1,1), //神兽椅
		Array(3010106,600,1,1), //雪狼战椅
		/*Array(3010063,700,1,1), //月亮星星抱枕椅
		Array(3010064,700,1,1), //棕色砂兔抱枕椅
		/*Array(3010067,800,1,1), //红色设计师椅
		Array(3010081,600,1,1), //红帽月妙抱枕椅
		Array(3010082,600,1,1), //蓝帽月妙抱枕椅
		Array(3010083,600,1,1), //扇子月妙抱枕椅
		Array(3010084,600,1,1), //太平萧月妙抱枕椅*/
		Array(3010108,700,1,1), //幼龙秋千
		Array(3010137,700,1,1), //神龙椅子*/
		//Array(3010939,100,1,1), //异界匈奴
		//Array(3012007,300,1,1), //石狮
		Array(3010133,600,1,1), //帐篷椅
		Array(3010179,700,1,1), //燕尾服猫咪椅
		Array(3010171,700,1,1), //过来抱抱椅
		Array(3010174,800,1,1), //女巫炼药椅
		Array(3010152,800,1,1), //黄三角帐篷椅
		//Array(3010543,700,1,1), //魔力品克缤
		Array(3010073,200,1,1), //baby品克缤
		Array(3010070,50,1,1), //巨无霸品克缤
		Array(3010041,700,1,1), //骷髅王座
		Array(3010044,50,1,1), //同一红伞下
		Array(3012006,300,1,1), //风吹稻香
		Array(3010075,700,1,1), //我为音乐狂
		Array(3012002,200,1,1), //浴桶
		Array(3010021,700,1,1), //暖暖桌
		//Array(3015147,800,1,1), //寿司椅
		//Array(3012008,300,1,1), //稻荷神社椅子
		Array(3010098,600,1,1), //电视宅人
		Array(3012010,300,1,1), //巧克力蛋糕恋人
		//Array(3010632,600,1,1), //印第安女孩
		//Array(3010767,600,1,1), //雪人椅子
		//Array(3010760,400,1,1), //古代浴池
		//Array(3010879,400,1,1), //繁星
		//Array(3010937,600,1,1), //异界半半
		//Array(3010938,400,1,1), //异界女王
		Array(3010058,600,1,1), //世界末日
		Array(3010130,600,1,1), //血色玫瑰
		/*Array(3010009,700,1,1), //榻榻凳
		Array(3010024,700,1,1), //玩具粉熊椅*/
		Array(3010038,500,1,1), //空气沙发
		Array(3010054,400,1,1), //呼噜呼噜床
		//Array(3010313,100,1,1), //粉色扎昆椅子
		Array(3010043,700,1,1), //魔女的飞扫把
		/*Array(3010017,700,1,1), //金色海豹靠垫
		Array(3010039,800,1,1), //黑色海狗靠垫
		//Array(3010693,800,1,1), //白色海豹椅子
		Array(3010007,700,1,1), //粉色海豹靠垫
		Array(3010008,700,1,1), //蓝色海豹靠垫*/
		Array(3012011,300,1,1), //我爱巧克力火锅
		Array(2510240,200,1,1),
		Array(2510241,200,1,1),
		Array(2510242,100,1,1),
		Array(2511107,200,1,1),
		Array(2510173,200,1,1),
		Array(2510174,200,1,1),
		Array(2511020,200,1,1),//旭日
		Array(2511041,100,1,1),
		Array(2511058,200,1,1),
		Array(2511080,100,1,1),
		Array(2511102,200,1,1),
		Array(2510162,200,1,1),//永恒
Array(2510163,120,1,1),
Array(2510164,120,1,1),
Array(2510197,120,1,1),
Array(2510198,120,1,1),
Array(2510199,120,1,1),
Array(2510200,120,1,1),
Array(2510201,120,1,1),
Array(2510202,120,1,1),
Array(2510203,120,1,1),
Array(2510204,120,1,1),
Array(2510205,120,1,1),
Array(2510206,120,1,1),
Array(2510207,120,1,1),
Array(2510208,120,1,1),
Array(2510209,120,1,1),
Array(2510210,120,1,1),
Array(2510211,120,1,1),
Array(2510212,120,1,1),
Array(2510213,120,1,1),
Array(2510214,120,1,1),
Array(2510215,120,1,1),
Array(2510216,120,1,1),
Array(2511023,120,1,1)
		/*Array(1040112,150,1,1), //蓝色崇高服（战士男90）
		Array(1060101,150,1,1), //蓝色崇高裤（战士男90）
		Array(1041118,150,1,1), //红扣带护甲（飞侠女90）
		Array(1061117,150,1,1), //红色霹雳裤（飞侠女90）
		Array(1072195,150,1,1), //红扣带靴
		Array(1040121,100,1,1), //蓝龙纹战甲（战士男100）
		Array(1060110,100,1,1), //蓝龙纹裤（战士男100）
		Array(1072222,100,1,1), //龙纹战靴(灰)
		Array(1040118,150,1,1), //红扣带护甲（飞侠男90）
		Array(1060107,400,1,1), //红色霹雳裤（飞侠男90）
		Array(1041120,150,1,1), //紫贵族铠甲（战士女90）
		Array(1061119,150,1,1), //粉色虎头裙（战士女90）
		Array(1041123,100,1,1), //蓝龙纹战甲（战士女100）
		Array(1061122,100,1,1), //紫龙纹裙（战士女100）
		Array(1040109,200,1,1), //红隐者之服（飞侠男80）
		Array(1060098,200,1,1), //红隐者之裤（飞侠男80）
		Array(1041106,200,1,1), //红隐者之服（飞侠女80）
		Array(1061105,200,1,1), //红骷髅皮裙（飞侠女80）
		Array(1050073,200,1,1), //蓝神仙之服（法师男78）
		Array(1051057,200,1,1), //紫神仙之服（法师女78）
		Array(1050077,200,1,1), //绿宫衣（弓箭男80）
		Array(1051068,200,1,1), //绿宫衣（弓箭女80）
		Array(1051080,200,1,1), //黑白银铠甲(战士女80）
		Array(1050083,200,1,1), //黑白银铠甲(战士男80）
		Array(1050090,200,1,1), //绿疾风服（弓箭男90）
		Array(1051084,200,1,1), //绿色高丽贵妇袍（弓箭女90）
		Array(1050094,200,1,1), //红祭司长袍（法师男88）
		Array(1051096,200,1,1), //红祭司长袍（法师女88）
		Array(1050098,100,1,1), //红侠盗服（飞侠男100）
		Array(1051092,100,1,1), //红侠盗服（飞侠女100）
		Array(1050105,100,1,1), //灰幻魔长袍（法师男98）
		Array(1051104,100,1,1), //灰幻魔长袍（法师女98）
		Array(1050108,100,1,1), //红飞羽服（弓箭男100）
		Array(1051107,100,1,1), //红飞羽服（弓箭女100）
		Array(1052071,50,1,1), //红色斗篷（弓箭男110）
		Array(1052072,50,1,1), //黑色格丽纳（飞侠男110）
		Array(1052075,50,1,1), //蓝龙装甲(战士男110）
		Array(1052076,50,1,1), //青龙长袍（法师男108）
		Array(1052125,200,1,1), //高军服（海盗男80）
		Array(1052128,150,1,1), //功勋海盗服（海盗男90）
		Array(1052131,100,1,1), //船长服（海盗男100）
		Array(1052134,50,1,1) //海盗大衣（海盗男110）
		//Array(1050176,300,1,1), //龙神男性全身服装
		//Array(1051217,300,1,1), //龙神女性全身服装
		//Array(1052434,100,1,1), //品克缤大衣
		//Array(1050237,50,1,1), //冒险勇士红色套装
		//Array(1051288,50,1,1), //冒险勇士黄色套装
		//Array(1050238,50,1,1), //冒险勇士绿色套装
		//Array(1050239,50,1,1), //冒险勇士蓝色套装
		//Array(1051287,50,1,1), //冒险勇士粉色套装
		/*Array(1072174,400,1,1), //黑飞影鞋
		Array(1072179,400,1,1), //黑密林之鞋
		Array(1072185,400,1,1), //黑飞翼鞋
		Array(1072212,400,1,1), //黄宝石靴
		Array(1072198,300,1,1), //银鳞甲靴
		Array(1072205,300,1,1), //夜精灵靴(黑)
		Array(1072209,300,1,1), //杰斯特鞋(黑)
		Array(1072216,200,1,1), //侠盗长靴(黑)
		Array(1072226,200,1,1), //杰斯特鞋(灰)
		Array(1072229,200,1,1), //飞羽鞋(绿)
		Array(1072268,100,1,1), //蓝色元素鞋
		Array(1072269,100,1,1), //红猎人鞋
		Array(1072272,100,1,1), //黑格丽纳鞋
		Array(1072273,100,1,1), //青龙长鞋
		Array(1072312,400,1,1), //伏波
		Array(1072315,300,1,1), //指挥官
		Array(1072318,200,1,1), //翻江
		Array(1072321,100,1,1), //镇海
		Array(1072718,50,1,1), //冒险勇士靴
		Array(1082477,50,1,1), //冒险勇士手套
		Array(3010049,600,1,1), //雪房子
		Array(3012001,200,1,1), //篝火
		Array(3010069,500,1,1), //大黄蜂
		Array(3010096,800,1,1), //恐龙化石
		Array(3010139,800,1,1), //私密空间
		Array(3010140,800,1,1), //早日康复
		Array(3010149,800,1,1), //猫咪风扇椅
		Array(3010169,800,1,1), //求领养
		Array(3010193,700,1,1), //炼金瓶
		Array(3010195,700,1,1), //无价之宝
		Array(3010289,400,1,1), //老奶奶读通话
		Array(3010293,400,1,1), //恶灵椅子
		Array(3010403,600,1,1), //音乐会
		Array(3010410,400,1,1), //珍妮
		Array(3010411,700,1,1), //双鱼
		Array(3010428,700,1,1), //水晶
		Array(3010438,700,1,1), //音符
		Array(3010453,700,1,1), //兔子
		Array(3010454,600,1,1), //爱心云朵
		Array(3010462,600,1,1), //天文台
		Array(3010494,600,1,1), //TV椅子
		Array(3010515,600,1,1), //奇石椅子
		Array(3010609,200,1,1), //不是在做梦
		Array(3010622,700,1,1), //丹真
		Array(3010633,600,1,1), //印第安
		Array(3010659,700,1,1), //巴士
		Array(3010716,500,1,1), //超级蘑菇
		Array(3010729,700,1,1), //孤独男子
		Array(3010730,500,1,1), //小企鹅合唱团
		Array(3010738,500,1,1), //闪电三人组
		Array(1072238,100,1,1),//紫色钉鞋
		Array(1072239,100,1,1),//黄色钉鞋
		Array(3010739,500,1,1) //雪人香波*/
);



function start() {
    action(1, 0, 0);
}

function action(mode, type, selection) {
    if (mode == 1) {
        status++;
    } else {
        if (status == 0) {
            cm.sendOk("不想使用吗？…我的肚子里有各类#b奇特座椅或卷轴、装备、新奇道具#k哦！");
            cm.dispose();
        }
        status--;
    }
	var jpzs = "";
    for(var j=0;j<itemList.length;j++){
    	jpzs+="#v" + itemList[j][0] + "#";
    }
    if (status == 0) {
		if(cm.getPlayer().getLevel() <10){
			cm.sendOk("您的等级太低，无法使用快乐百宝箱。");
			cm.dispose();
			return;
		}
        if (cm.haveItem(5220010,1)) {
            cm.sendSimple("冒险岛转蛋机中有各类#b装备、卷轴或稀有新奇的道具#k噢！使用“#b#t5220010##k”就可以抽奖，否则是不可以使用我的。现在要玩转蛋机么? \r\n#b#L2#试试手气吧#l#k\r\n#b#L4#十连抽#l#k\r\n\r\n\r\n奖励展示:\r\n" + jpzs);
        } else {
        	cm.sendSimple("冒险岛转蛋机中有各类#b装备、卷轴或稀有新奇的道具#k噢！使用“#b#t5220010##k”就可以交换。 假如不买转蛋券的话，是不可以使用我的。现在要玩转蛋机么?    \r\n\r\n#r你背包里没#v5220010##z5220010#\r\n\r\n#k奖励展示:\r\n" + jpzs +"");
        }
    } else if (selection == 2) {
        var chance = Math.floor(Math.random() * 700);
        var finalitem = Array();
        for (var i = 0; i < itemList.length; i++) {
            if (itemList[i][1] >= chance) {
                finalitem.push(itemList[i]);
            }
        }
        if (finalitem.length != 0) {
            var item;
            var random = new java.util.Random();
            var finalchance = random.nextInt(finalitem.length);
            var itemId = finalitem[finalchance][0];
            var quantity = finalitem[finalchance][2];
            var notice = finalitem[finalchance][3];
			if (item != -1) {
				if (itemId == 1022212) {
					cm.gainItem(5220010, -1);
					cm.gainItemB(1022212,1,0,0,0,"",20,20,20,20,20,20,0);
					cm.worldMessage(5,"[#z"+itemId+"#]被 "+cm.getPlayer().getName()+"抽到，大家一起恭喜我吧！！！")
					cm.setBossRankCount("抽奖积分",1);
					cm.sendOk("你获得了 #b#t" + item + "##k " + quantity + "个。");
					cm.dispose();
				}
				item = cm.gainGachaponItem(itemId, quantity, "快乐百宝箱", notice);
                cm.gainItem(5220010, -1);
				cm.setBossRankCount("抽奖积分",1);
                cm.sendOk("你获得了 #b#t" + item + "##k " + quantity + "个。");
				cm.dispose();
                //给1个纪念币
               // cm.给物品(2000005,1);
            } else {
                cm.sendOk("你确实有#b#t5220010##k吗？如果是，请你确认在背包的装备，消耗，其他窗口中是否有一格以上的空间。");
            }
            cm.safeDispose();
        } else {
            cm.sendOk("今天的运气可真差，什么都没有拿到。\r\n(获得了安慰奖：#v2000005#。)");
            cm.gainItem(5220010, -1);
           // cm.gainItem(2000005, 1);
            //给1点积分
            cm.setBossRankCount("抽奖积分",1);
			//cm.setBossRankCount("快乐百宝箱抽奖积分",1);
            cm.safeDispose();
        }
    } else if  (selection == 4) {
		var itemids = [];
		if (!cm.haveItem(5220010,10)){
			cm.sendOk("你的 #b#t5220010# #k不够 #r10 #k张，无法抽奖。");
			cm.dispose();
			return;
		}
		if (cm.getInventory(1).isFull(9)){
			cm.sendOk("请保证背包#b装备栏#k至少有 #r10 #k个位置");
			cm.dispose();
			return;
		}
		if (cm.getInventory(2).isFull(9)){
			cm.sendOk("请保证背包#b消耗栏#k至少有 #r10 #k个位置");
			cm.dispose();
			return;
		}
		if (cm.getInventory(3).isFull(9)){
			cm.sendOk("请保证背包#b设置栏#k至少有 #r10 #k个位置");
			cm.dispose();
			return;
		}
		if (cm.getInventory(4).isFull(9)){
			cm.sendOk("请保证背包#b其他栏#k至少有 #r10 #k个位置");
			cm.dispose();
			return;
		}
		for (var j = 0; j < 10;j ++) {
			var chance = Math.floor(Math.random() * 700);
			var finalitem = Array();
			for (var i = 0; i < itemList.length; i++) {
				if (itemList[i][1] >= chance) {
                finalitem.push(itemList[i]);
				}
			}
			if (finalitem.length != 0) {
				var item;
				var random = new java.util.Random();
				var finalchance = random.nextInt(finalitem.length);
				var itemId = finalitem[finalchance][0];
				var quantity = finalitem[finalchance][2];
				var notice = finalitem[finalchance][3];
				if (item != -1) {
					cm.gainItem(5220010, -1);
				if (itemId == 1022212) {
					cm.gainItemB(1022212,1,0,0,0,"",20,20,20,20,20,20,0);
					itemids.push(itemId);
					cm.worldMessage(5,"[#z"+itemId+"#]被 "+cm.getPlayer().getName()+"抽到，大家一起恭喜我吧！！！")
					cm.setBossRankCount("抽奖积分",1);
				} else {
					item = cm.gainGachaponItem(itemId, quantity, "快乐百宝箱", notice);
					cm.setBossRankCount("抽奖积分",1);
					itemids.push(itemId);
				}
					//给1个纪念币
					//cm.gainItem(4000000,1);
				} else {
					cm.sendOk("你确实有#b#t5220010##k吗？如果是，请你确认在背包的装备，消耗，其他窗口中是否有一格以上的空间。");
				}
				cm.safeDispose();
			} else {
				cm.sendOk("今天的运气可真差，什么都没有拿到。\r\n(获得了安慰奖：#v2000005#。)");
				cm.setBossRankCount("抽奖积分",1);
				cm.gainItem(5220010, -1);
				cm.gainItem(4000000, 1);
				cm.safeDispose();
			}
        }
		var idtext = "以下是你抽到的物品:\r\n";
		for (var c = 0;c<itemids.length; c++) {
			idtext += "#v" + itemids[c] + "##z" + itemids[c] + "#\r\n";
		}
		cm.sendSimple(idtext);
		cm.safeDispose;
	}
}